<template>
  <component :is="size">{{ label }}</component>
</template>

<script>

export default {
  name: "EvTitle",
  props: {
    label: {
      type: String,
      default: "我是标题",
    },
    size: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      // size: this.validateSize(this.size),
    };
  },
  methods: {
    validateSize(size) {
      const validTags = ["h1", "h2", "h3", "h4", "h5", "h6"];
      return validTags.includes(size) ? size : "h1";
    },
  },
  created() {
    // this.size = this.validateSize(this.size);
  },
};
</script>

<style scoped>
</style>